/* eslint-disable */
// @ts-ignore
import { queryOptions, useMutation } from '@tanstack/vue-query';
import type { DefaultError } from '@tanstack/vue-query';
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as apis from './indexController';
import * as API from './types';

/** 公共配置 GET /api/index/config */
export function configUsingGetQueryOptions(options: {
  options?: CustomRequestOptions;
}) {
  return queryOptions({
    queryFn: async ({ queryKey }) => {
      return apis.configUsingGet(queryKey[1] as typeof options);
    },
    queryKey: ['configUsingGet', options],
  });
}

/** 装修数据 GET /api/index/decorate */
export function decorateUsingGetQueryOptions(options: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.decorateUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return queryOptions({
    queryFn: async ({ queryKey }) => {
      return apis.decorateUsingGet(queryKey[1] as typeof options);
    },
    queryKey: ['decorateUsingGet', options],
  });
}

/** 热门搜索 GET /api/index/hotSearch */
export function hotSearchUsingGetQueryOptions(options: {
  options?: CustomRequestOptions;
}) {
  return queryOptions({
    queryFn: async ({ queryKey }) => {
      return apis.hotSearchUsingGet(queryKey[1] as typeof options);
    },
    queryKey: ['hotSearchUsingGet', options],
  });
}

/** 首页数据 GET /api/index/index */
export function indexUsingGetQueryOptions(options: {
  options?: CustomRequestOptions;
}) {
  return queryOptions({
    queryFn: async ({ queryKey }) => {
      return apis.indexUsingGet(queryKey[1] as typeof options);
    },
    queryKey: ['indexUsingGet', options],
  });
}

/** 政策协议 GET /api/index/policy */
export function policyUsingGetQueryOptions(options: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.policyUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return queryOptions({
    queryFn: async ({ queryKey }) => {
      return apis.policyUsingGet(queryKey[1] as typeof options);
    },
    queryKey: ['policyUsingGet', options],
  });
}
